﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

// SIRP Experimental Firmware
// Misc stuff
// (c) 2014 Chris Burri. MIT License applies. 
// See http://niston.wordpress.com

namespace sdd.utilities
{
    public static class BassNetLic
    {
        public static BassNetLicInfo GetBassNetLicInfo()
        {
            try
            {
                // load license file
                string line = "";
                using (StreamReader sr = new StreamReader("bassnet.lic"))
                {
                    line = sr.ReadToEnd();
                    sr.Close();
                }

                string[] components = line.Split(' ');
                BassNetLicInfo licInf = new BassNetLicInfo(components[0], components[1]);

                // all is good
                return licInf;
            }
            catch
            {
                // summit went wrong
                return null;
            }
        }
        
        public class BassNetLicInfo
        {
            public string EMail { private set; get; }
            public string RegKey { private set; get; }
            public BassNetLicInfo(string eMail, string regKey)
            {
                EMail = eMail;
                RegKey = regKey;
            }
        }
    }


}
